package com.bianxingji.service;


import com.bianxingji.model.PageParams;
import com.bianxingji.model.PageResult;
import com.bianxingji.model.RestResponse;
import com.bianxingji.model.dto.QueryMediaParamsDto;
import com.bianxingji.po.BxjMediaFiles;
import org.springframework.web.multipart.MultipartFile;

import java.io.File;

/**
 * @description 媒资文件管理业务类
 * @author Mr.M
 * @date 2022/9/10 8:55
 * @version 1.0
 */
public interface BxjMediaFileService {

 /**
  * @description 媒资文件查询方法
  * @param pageParams 分页参数
  * @param queryMediaParamsDto 查询条件
  * @author Mr.M
  * @date 2022/9/10 8:57
  */
 public PageResult<BxjMediaFiles> queryMediaFiels(Long companyId, PageParams pageParams, QueryMediaParamsDto queryMediaParamsDto);
 public BxjMediaFiles uploadAvatar(byte[] file,String fileType);

 public String getUrlById(String id);

 public RestResponse<Boolean> checkFile(String fileMd5);

 RestResponse<Boolean> checkChunk(String fileMd5, int chunk);

 RestResponse uploadChunk(String fileMd5, int chunk, String localFilePath);

 RestResponse uploadImg(MultipartFile file);

 public RestResponse mergechunks(String fileMd5,int chunkTotal,BxjMediaFiles bxjMediaFiles);

 /**
  * 从minio下载文件
  * @param bucket 桶
  * @param objectName 对象名称
  * @return 下载后的文件
  */
 public File downloadFileFromMinIO(String bucket, String objectName);


}
